package com.example.localareanetworkchat.persistence.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.localareanetworkchat.persistence.entity.User

@Dao
interface UserDao {

    @Query("select count(*) from user where name = :name")
    fun queryByName(name: String): Int

    @Query("select * from user where name = :name and password = :password")
    fun queryByNameAndPassword(name: String, password: String): User

    @Insert
    fun insert(user: User)

}